<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0041)http://passport.blogbus.com/register_form -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link href="../css/style.css" rel="stylesheet" type="text/css">
<title>注册我的通行证_博客大巴</title>
</head>
<body>
<script type="text/javascript" src="../script/jquery.js"></script>
<div id="outterWrapper">
<div id="container">
	<div id="header">
    	<h1 class="bannerReg">注册我的通行证</h1>
    <div class="subNavi"><a href="http://passport.blogbus.com/login_form">登录</a></div></div>
    <div id="content">
    	<div id="main">
            <script type="text/javascript">
function reload_captcha() {
$('#captcha').attr('src', '/captcha.php?'+Math.random());
}
function remote_check(type, str) {
  var url='http://passport.blogbus.com/api/users/test';
  var ret;
  $.ajax({'url':url,'async':false,'dataType':'json','data':{'type':type,'str':str},'success':function(data){ret=data;}});
  return ret.result;
}
var validator={
'username':[
  [/\S+/, '请输入用户名'],
  [/\S{4,}/, '用户名少于4位'],
  [function(username){return remote_check('username',username);}, '此用户名已被使用']
],
'password':[
  [/^.+$/, '请输入密码'],
  [/^.{6,}$/, '密码少于6位']
],
'confirm':[
  [/^.+$/, '请输入确认密码'],
  [function(s){return s==$('#item_password input').val();}, '两次密码输入不一致']
],
'email':[
  [/\S+/, '请输入电子邮件'],
  [/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i, '请输入格式正确的电子邮件'],
  [function(email){return remote_check('email',email)}, '此电子邮件已被使用']
],
'captcha':[
  [/\S+/,'请输入验证码']
]
};
function validate(item) {
  var str=$("#item_"+item+" input").val();
  var m={
    'RegExp':function(r,s){
      return r.test(s);
    },
    'Function':function(f,s){
      return f(s);
    },
    'String':function(v,s){return v==s;}
  };
  for (var v in validator[item]) {
    var vi=validator[item][v];
    //var c=vi[0].constructor.name;
    var c=Object.prototype.toString.apply(vi[0]).match(/(\w+)\]$/)[1];
    if (m[c] && !m[c](vi[0],str)) {
      fail(item,vi[1]);
      return false;
    }
  }
  succ(item);
  return true;
}
var result={};
for (var k in validator) {
result[k]=false;
}
function fail(item, msg) {
$("#item_"+item+" .f3 span").html(msg).removeClass('valid').addClass('fail');
result[item]=false;
disable();
}
function succ(item) {
$("#item_"+item+" .f3 span").html('&nbsp;').removeClass('fail').addClass('valid');
result[item]=true;
check_all();
}
function check_all() {
for (var k in result){
  if (result[k]==false){
    disable();
    return true;
  }
}
if (!$('#agree').attr('checked')) {
  disable();
  return true;
}
enable();
return true;
}
function enable(){
$('#submit_enabled').show();
$('#submit_disabled').hide();
return true;
}
function disable(){
$('#submit_enabled').hide();
$('#submit_disabled').show();
return false;
}
function check_and_submit() {
if (!check_all()) {
return;
}
$('form')[0].submit();
}
$('#header').append('<div class="subNavi"><a href="/login_form">登录</a></div>')
</script>
<div id="sideMain">
	<div id="regForm">
	<form action="http://passport.blogbus.com/register" method="post">
		<ul>
			<li id="item_username">
				<div class="f1"><strong>用户名</strong></div>
				<div class="f2"><input type="text" class="text" maxlength="16" name="username"></div>
				<div class="f3"><span></span></div>
				<div class="f4">由4-16位任意字符组成</div>
			</li>
			<li id="item_password">
				<div class="f1"><strong>密　码</strong></div>
				<div class="f2"><input type="password" class="text" maxlength="16" name="password"></div>
				<div class="f3"><span></span></div>
				<div class="f4">由6-16位字符组成</div>
			</li>
			<li id="item_confirm">
				<div class="f1"><strong>确认密码</strong></div>
				<div class="f2"><input type="password" class="text" maxlength="16" name="confirm"></div>
				<div class="f3"><span></span></div>
				<div class="f4">由6-16位字符组成</div>
			</li>
			<li id="item_email">
				<div class="f1"><strong>电子邮件</strong></div>
				<div class="f2"><input type="text" class="text" maxlength="50" name="email"></div>
				<div class="f3"><span></span></div>
				<div class="f4">请填写有效电子邮件，以获得注册验证信</div>
			</li>
			<li class="validCode" id="item_captcha">
				<div class="f1"><strong>验证码</strong></div>
				<div class="f2"><span><img src="./captcha.php" id="captcha" onclick="reload_captcha()"><a href="http://passport.blogbus.com/register_form#" onclick="reload_captcha();">换一张</a></span></div>
				<div class="clear"></div>
				<div class="f5">
				  <input type="text" class="text" maxlength="6" name="captcha">
				</div>
				<div class="f3"><span></span></div>
				<div class="f4">不区分大小写</div>
			</li>
			<li class="agreement" id="item_agree">
				<div class="f4"><input name="agree" id="agree" type="checkbox" value="1" checked="checked" class="checkbox"> <span>我已阅读并同意<a href="http://www.blogbus.com/about/blogserviceterm.html" target="_blank">服务条款</a></span></div>
			</li>
		</ul>
		<div class="button">
			<img id="submit_enabled" onclick="check_and_submit();" src="../image/btn_reg.gif" title="同意协议并注册" style="cursor:pointer;display:none;">
			<img id="submit_disabled" src="../image/btn_reg_invalid.gif" title="同意协议并注册">
		</div>
	</form>
	</div>
</div>
<script type="text/javascript">
$('#regForm input')
.blur(function(){validate(this.name);})
.change(check_all);
</script>
<div id="sideSub">
	<div class="regFlow">
		<ol class="on01">
			<li><strong>填写信息</strong></li>
			<li>验证邮件</li>
			<li>注册成功</li>
		</ol>
	</div>
	<script type="text/javascript">
	$($('div.regFlow li')[0]).wrapInner('<strong></strong>');
	</script>
	<div class="subNotice">
		<p>注册通行证可同时登录:</p>
		<p><img src="../image/icon_blogbus.gif" width="16" height="17"> <a href="http://www.blogbus.com/" target="_blank">博客大巴</a></p>
		<p><img src="../image/icon_yohocity.gif" width="16" height="16"> <a href="http://www.yohocity.com/" target="_blank">吆喝城</a></p>
		<p><img src="../image/icon_icity.gif" width="16" height="16"> <a href="http://www.icity.cn/" target="_blank">城客</a></p>
		<p>让您写博、交友、互动、领取试用，一个都不少。</p>
	</div>
</div>

            <div class="clear"></div>
        </div>
    </div>
    <div id="footer">
    	<div class="copyright">© 2002-2012 BlogBus.com, All Rights Reserved.<br>博客大巴 版权所有 沪ICP B2-20080056号</div>
    </div>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script src="../script/ga.js" type="text/javascript"></script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-2120146-17");
pageTracker._trackPageview();
} catch(err) {}</script>


</body></html>